package com.usian.wemedia.controller;

import com.usian.api.wemedia.WmUserControllerApi;
import com.usian.model.common.dtos.ResponseResult;
import com.usian.model.media.pojos.WmUser;
import com.usian.wemedia.service.WmUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/user")
public class WmUserController implements WmUserControllerApi {

    @Autowired
    private WmUserService wmUserService;

    @Override
    @PostMapping("/save")
    public WmUser saveUser(@RequestBody WmUser wmUser) {
        return wmUserService.saveUser(wmUser);
    }

    @Override
    @GetMapping("/findByName/{name}")
    public WmUser findByName(@PathVariable String name) {
        return wmUserService.findByName(name);
    }
}
